function setRootFontSize () {
    var docEl = top.document.documentElement,
        clientWidth = docEl.clientWidth;
    if (clientWidth < 1366) clientWidth = 1366;
    document.documentElement.style.fontSize = (5 / 96 * clientWidth) + 'px';
}

var pageResizeTimer = null;

export default function setBasicSize () {
    window.addEventListener('DOMContentLoaded', function () {
        setRootFontSize();
    });

    window.addEventListener('resize', function () {
        if (pageResizeTimer) clearTimeout(pageResizeTimer);
        pageResizeTimer = this.setTimeout(setRootFontSize, 50);
    });
}